import { RouteRecordRaw } from 'vue-router';
import MainLayout from '@/layout/index.vue';
import EmptyLayout from '@/layout/empty.vue';
import CimupLayout from '@/layout/cimup.vue';

const routes: RouteRecordRaw = {
  path: '/resource',
  name: 'resource',
  redirect: '/resource/list',
  meta: {
    path: '/resource',
    title: '资源管理',
    icon: 'ic_ziyuan',
    layout: MainLayout,
  },
  component: EmptyLayout,
  children: [
    {
      path: 'list',
      name: 'resourceList',
      meta: {
        path: '/resource/list',
        title: '资源管理',
        hidden: true,
      },
      // component: () => import('@/views/resource/list/index.vue'),
      component: () => import('@/views/resource/index/index.vue'),
    },
    {
      path: 'preview/:id',
      name: 'resourcePreview',
      meta: {
        path: '/resource/preview',
        title: '资源预览',
        layout: CimupLayout,
        hidden: true,
      },
      component: () => import('@/views/resource/detail/index.vue'),
    },
  ],
};

export default routes;
